package org.aynu.paymentservice.domain;

import java.io.Serial;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 支付表
 * </p>
 *
 * @author 小粥
 * @since 2025-03-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("payments")
public class Payments implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @TableId(value = "payment_id", type = IdType.AUTO)
    private Integer paymentId;

    /**
     * 订单Id（可选，用于订单支付）
     */
    private Integer orderId;

    /**
     * 物业费账单Id（可选，用于物业费支付）
     */
    private Integer feeId;

    /**
     * 支付金额
     */
    private BigDecimal amount;

    /**
     * 支付方式
     */
    private String paymentMethod;

    /**
     * 支付状态
     */
    private String status;

    /**
     * 交易Id
     */
    private Long transactionId;

    /**
     * 创建时间
     */
    private LocalDateTime createdAt;

    public Payments() {
        this.transactionId = com.baomidou.mybatisplus.core.toolkit.IdWorker.getId();
        this.createdAt = LocalDateTime.now();
    }
}